<?php
//工厂类
class App_Item 
{
    public static function factory ($type, $nid)
    {
        switch ($type)
        {
            case 'goods':
                return new App_Goods($nid);
                break;

            case 'shop':
                return new App_Shop($nid);
                break;

            case 'topic':
                $topic = new App_Topic($nid);
                return $topic;

            case 'show':
                $show = new App_Show();
                $show->setNid($nid);
                return $show;

            default:
                throw new Exception("App_Item::facotry($type) ERROR");
                break;
        }
    }
}
